<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function Person(name, age) {
      this.name = name
      this.age = age
    }
    // 构造函数的原型对象的属性和方法可以被构造函数的实例所访问
    Person.prototype.gender = '男'
    let p = new Person('张三', 18)
    console.log(p, name)
    console.log(p.age)
    console.log(p.gender)
  </script>
</body>

</html>